package com.gwgreenway.oauth2.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import java.security.Principal;

@RestController
@RequestMapping("/user")
public class UserController {


    /**
     * 如果其他资源服务器需要验证Token 则需要远程调用授权服务暴露的验证Token的API接口
     * @param principal
     * @return
     */
    @RequestMapping(value = "/info", method = RequestMethod.GET)
    public Principal getUser(Principal principal) {
        return principal;
    }


}
